package com.begonzales.locker.dto;

/**
 * Created by IntelliJ IDEA.
 * User: begonza
 * Date: 9/19/11
 * Time: 11:09 PM
 * To change this template use File | Settings | File Templates.
 */
public class DTOAnnotation {

    protected String annotationName = "";
    protected String name = "";
    protected String value = "";
    protected int nary = 2;

    public int getNary() {
        return nary;
    }

    public void setNary(int nary) {
        this.nary = nary;
    }

    public DTOAnnotation(String annotationName, String name, String value)
    {
        this.annotationName = annotationName;
        this.name = name;
        this.value = value;
        this.nary = 2;
    }
    public String toString()
    {
        String retval = "";
        if ( 1 == nary )
        {
            retval = retval +
                "\t" + "@"  + this.getAnnotationName()  + "(" + this.getValue() + ")\r\n";
        }
        if ( 2 == nary )
        {
            retval = retval +
                "\t" + "@"  + this.getAnnotationName()  + "(" + this.getName() + " = " + this.getValue() + ")\r\n";
        }
        return retval;
    }

    public String getAnnotationName() {
        return annotationName;
    }

    public void setAnnotationName(String annotationName) {
        this.annotationName = annotationName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
